<?php 

namespace App\Models\ModelFilters;

use EloquentFilter\ModelFilter;

class FreightWayFilter extends ModelFilter
{
    /**
    * Related Models that have ModelFilters as well as the method on the ModelFilter
    * As [relationMethod => [input_key1, input_key2]].
    *
    * @var array
    */
    public $relations = [];

    public function state($state)
    {
    	if($state == 1){
    		return $this->where('state', '>=', 1);    		
    	}elseif($state == 'defect'){
    		return $this->whereRaw('stock < capacity');
    	}
    }

    
}
